package cn.itcast.jd.service.impl;

import cn.itcast.jd.dao.NewDao;
import cn.itcast.jd.pojo.Item;
import cn.itcast.jd.pojo.New;
import cn.itcast.jd.service.NewService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Example;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by Administrator on 2019/8/9.
 */
@Service
public class NewServiceImpl implements NewService {

    @Autowired
    private NewDao newDao;

    @Override
    public void save(New news) {
        this.newDao.save(news);
    }

    @Override
    public List<New> findAll(New news) {
        Example<New> example=Example.of(news);
        //Example<Item> example=Example.of(item);

        List<New> list=this.newDao.findAll(example);

        return list;

    }
}
